package com.zking.service.impl;

import com.zking.dao.domain.Patient;
import com.zking.dao.domain.Register;
import com.zking.dao.domain.RegisterMonth;
import com.zking.dao.mapper.RegisterMapper;
import com.zking.service.RegisterService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author Tanglei
 * @date 2020/8/21 - 16:57
 */
@Service
public class RegisterServiceImpl implements RegisterService {

    @Autowired
    RegisterMapper registerMapper;

    @Override
    public List<Register> queryAllRegister() {
        List<Register> registers = registerMapper.queryAllRegister();
        return registers;
    }

    @Override
    public List<RegisterMonth> registerNumsMonthly() {
        List<RegisterMonth> registerMonths = registerMapper.registerNumsMonthly();
        return registerMonths;
    }
    @Override
    public List<Register> queryAllRegisterByPid(Patient patient){
        List<Register>  registers = registerMapper.queryAllRegisterByPid(patient);
        return  registers;
    }

    @Override
    public void updateRegState(int id) {
        registerMapper.UpdateRegState(id);
    }
}
